package com.hdax.dm.mapstrucs;
import com.hdax.dm.dto.FlootDto;
import com.hdax.dm.entity.item.DmItem;
import com.hdax.dm.entity.item.DmItemType;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import java.util.List;

@Mapper(componentModel = "spring")
public abstract class FloorDtoMapper {
    @Mappings({
            @Mapping(source = "id",target = "index"),
            @Mapping(source = "id",target = "itemTypeId"),
            @Mapping(source = "itemType",target = "itemTypeName")
    })
    public abstract FlootDto toTarget(DmItemType dmItemType);

    //toTargets写了必须写toTarget，这样才能赋上值
    public abstract List<FlootDto> toTargets(List<DmItemType> dmItemTypes);
}
